<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" import="java.util.*" import="com.annefish.shop.webapp.util.RequestUtil" pageEncoding="utf8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>" type="text/css" />

	</head>
	<body style="">

		<div id="headBar" class="head_content"></div>
		<div id="main" class="main_content">
			<div style="padding: 10px;">
				<div class="note">
					站外推广链接功能帮助您将商品或者商店的网页地址创建为一个站外推广链接，您可以将站外推广链接以图片或者文字方式投放在其他网站上，这样顾客就可以从其他网站上通过这个链接访问您的商店并且购物下订单，系统也会在订单信息里面记录此订单来源。
				</div>
			</div>
			<div class="tableform">
				<h4>
					创建站外推广链接
				</h4>
				<div class="division">
					<div class=" current">
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody>
								<tr>
									<th>
										要推广的网页地址：
									</th>
									<td>
										<input class="x-input " id="url" style="width: 360px;" value="${systemSettings.data}" size="50" />
									</td>
								</tr>
								<tr>
									<th>
										来源ID：
									</th>
									<td>
										<input class="x-input " parameter="from" id="from" style="width: 120px;" />
									</td>
								</tr>
								<tr>
									<th>
										期望的地址：
									</th>
									<td>
										<input class="x-input" parameter="redirect" id="redirect" style="width: 120px;" />
									</td>
								</tr>
								<tr>
									<th>
										&nbsp;
									</th>
									<td>
										<b class="submitBtn"><input value="生成站外推广链接" type="button" onclick="createOutLink()" /> </b>
									</td>
								</tr>
								<tr>
									<th>
										&nbsp;
									</th>
									<td>
										<textarea id="generatecode" name="generatecode" style="width: 560px;"></textarea>
										<br />
										<br />
										<span class="fontcolorGray">复制此站外推广链接到投放位置即可</span>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>

			</div>
		</div>
		<div id="footBar" class="foot_content"></div>


		<script type="text/javascript" src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script> 
		<script type="text/javascript">
	 		function createOutLink(){
	 			var url = $('#url').val();
	 			var from = $('#from').val();
	 			var redirect = $('#redirect').val();
	 			
	 			
	 			if(url==''){
	 				alert('输入网址');
	 				return;
	 			}
	 			if(from==''){
	 				alert('输入来源ID');
	 				return;
	 			}
	 			var lastChar = url.charAt(url.length-1);
	 			alert(lastChar);
	 			if(lastChar != '/'){
	 				url += '/';
	 			}
	 			var generatecode = url+'market_member_from.html?from='+from;
	 			
	 			$('#generatecode').val(generatecode);
	 			
	 		}
		</script>
	</body>
</html>